package org.liukai.ssh_ems.service;

import org.liukai.ssh_ems.dao.EmpDao;
import org.liukai.ssh_ems.entity.po.Emp;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @project ssh_ems
 * @create EmpService.java 
 * 
 * @author liukai
 * @date 2016/1/13 11:05
 * @detail 
 */
@Service
public class EmpService {
    @Resource
    private EmpDao empDao;

    public List<Emp> queryEmpList() {
        return empDao.queryEmpList();
    }

    public void deleteEmp(Integer empId){
        Emp emp = new Emp();
        emp.setEmpId(empId);
        empDao.deleteEmp(emp);
    }

    public void insertEmp(Emp emp) {
        empDao.insertEmp(emp);
    }

    public void updateEmp(Emp emp) {
        empDao.updateEmp(emp);
    }

    public Emp queryEmpById(Integer empId) {
        return empDao.queryEmpById(empId);
    }



    public EmpService() {
        System.out.println("实例化EmpService");
    }
}
